﻿using MvcBJDCWebApp.Models.League;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Web;

namespace MvcBJDCWebApp.DAL
{
    public class LeagueContext: DbContext
    {
        public DbSet<League> Leagues { get; set; }
        public DbSet<LeagueType> LeagueTypes { get; set; }
        public DbSet<LeagueDetail> LeagueDetails { get; set; }
        public DbSet<Scorecard> Scorecards { get; set; }
        public DbSet<Marksman> Marksmans { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

            //modelBuilder.Entity<Course>()
            //    .HasMany(c => c.Instructors).WithMany(i => i.Courses)
            //    .Map(t => t.MapLeftKey("CourseID")
            //        .MapRightKey("InstructorID")
            //        .ToTable("CourseInstructor"));

            //modelBuilder.Entity<Department>().MapToStoredProcedures();
        }
    }
}